import { createApp} from 'vue'
import './assets/css/style.scss'
import './config/permission'
import './assets/fonts/iconfont.css'

import App from './App.vue'
const app = createApp(App);

// 路由设置
import router from './router/index'
app.use(router);

import { setupStore } from './store/index'
// 挂载store
setupStore(app);

// element-plus
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
// 引入中文语言包
import zhLocale from 'element-plus/dist/locale/zh-cn.mjs'
// 导入所有的icon图标
import * as ElementPlusIconsVue from '@element-plus/icons-vue'

app.use(ElementPlus, {
    locale: zhLocale
});
app.use(ElementPlus);
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
}

// 引入Echarts
import echarts from './utils/echarts'
// echarts 挂载到 Vue实例中
// 注意：app.config.globalProperties 和 app.provide('$echarts', echarts) 二选一即可
// app.config.globalProperties.$echarts = echarts; // vue3的挂载方式（一个用于注册能够被应用内所有组件实例访问到的全局属性的对象。）
app.provide('$echarts', echarts); // vue3采用provide, inject方式使用



app.mount('#app');
